package com.blb.springboot;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.hello.HelloService;
import com.blb.springboot.entity.Log;
import com.blb.springboot.entity.StudentPro;
import com.blb.springboot.mapper.LogMapper;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * @author lvtian
 * @date 2023/1/9 10:42
 */
@SpringBootTest
//        (classes = SpringbootApplication.class)
//@RunWith(SpringRunner.class)
class SpringbootApplicationTest2 {

    @Autowired
    private StudentPro studentPro;
    @Autowired
    private LogMapper logMapper;
    @Test
     void testStudent(){
        System.out.println(studentPro);
    }
    @Test
    public void page(){
        IPage<Log> logIPage = logMapper.selectAll(new Page<>(1, 5));
        List<Log> logs = logIPage.getRecords();
        logs.forEach(log -> {
            System.out.println(log);
        });
    }
    @Autowired
    private HelloService helloService;
    @Test
    public void hello(){
        String s = helloService.sayHello();
        System.out.println(s);

    }

}
